//
//  HTMyAnnotation.m
//  TruckUser
//
//  Created by Ting Han on 2017/10/17.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import "HTMyAnnotation.h"
#import "HTMyAnnotationView.h"

@implementation HTMyAnnotation

- (MAAnnotationView *)getAnnotationView:(MAMapView *)mapView{
    HTMyAnnotationView *annotationView = [self setupWithView:mapView identifier:@"myAnnotation"];
    if (self.state != nil && [self.state isEqualToString:@"0"]) {//停止
        annotationView.image = [UIImage imageNamed:@"icon_map_location"];
    }else{//运输中
        annotationView.image = [UIImage imageNamed:@"icon_fh_cf"];
    }
    return annotationView;
}
- (HTMyAnnotationView *)setupWithView:(MAMapView *)mapView
                             identifier:(NSString *)identifer
{

    HTMyAnnotationView *annotationView = (HTMyAnnotationView*)[mapView dequeueReusableAnnotationViewWithIdentifier:identifer];
    if (annotationView == nil)
    {
        annotationView = [[HTMyAnnotationView alloc] initWithAnnotation:self
                                                      reuseIdentifier:identifer];
    }
    annotationView.canShowCallout               = NO;
    annotationView.draggable                    = NO;
    annotationView.ID = self.ID;
    return annotationView;
}


@end
